package xjtu.zd.server.staff.data;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xjtu.zd.server.common.Result;
import xjtu.zd.server.staff.data.dao.DataDao;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/staff/data")
public class DataController {

    @Resource
    private DataService dataService;
    

    @GetMapping("/getuserdata")
    public Result getuserData() { return Result.success(dataService.userDataPermon()); }

    @GetMapping("/getbookdata")
    public Result getbookData(){
        return Result.success(dataService.bookDataPermon());
    }

    @GetMapping("/user12m")
    public Result user12m() { return Result.success(dataService.userData12m()); }

    @GetMapping("/book12m")
    public Result book12m(){
        return Result.success(dataService.bookData12m());
    }

    @GetMapping("/getactive")
    public Result getactive() { return Result.success(dataService.activeAmon());}
}
